home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / misc / ImageFXDevKit.lha / sdev / sas / examples / drawmodes / skeleton.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-26  |  3.6 KB  |  142 lines

  1. /*
  2.  * A Drawing Mode for ImageFX 1.5
  3.  *
  4.  */
  5.  
  6. #include <exec/types.h>
  7. #include <scan/modall.h>
  8.  
  9.  
  10. /**********************************************************************\
  11.  
  12.                                 Library Vectors
  13.  
  14. \**********************************************************************/
  15.  
  16. /*
  17.  * Initialize before a series of PutColor or PutGrey's.
  18.  *
  19.  */
  20. int __asm DM_PutInit (void)
  21. {
  22.    return(1);
  23. }
  24.  
  25. /*
  26.  * Cleanup after a series of PutColor or PutGrey's.
  27.  *
  28.  */
  29. void __asm DM_PutCleanup (void)
  30. {
  31. }
  32.  
  33. /*
  34.  * Write a color pixel.
  35.  *
  36.  */
  37. void __asm DM_PutColor (register __a0 short *destr,
  38.                         register __a1 short *destg,
  39.                         register __a2 short *destb,
  40.                         register __d0 LONG oldr,
  41.                         register __d1 LONG oldg,
  42.                         register __d2 LONG oldb,
  43.                         register __d3 LONG newr,
  44.                         register __d4 LONG newg,
  45.                         register __d5 LONG newb,
  46.                         register __d6 LONG x,
  47.                         register __d7 LONG y)
  48. {
  49. }
  50.  
  51. /*
  52.  * Write a greyscale pixel.
  53.  *
  54.  */
  55. void __asm DM_PutGrey  (register __a0 short *destg,
  56.                         register __d0 LONG oldg,
  57.                         register __d1 LONG newg,
  58.                         register __d6 LONG x,
  59.                         register __d7 LONG y)
  60. {
  61. }
  62.  
  63. /*
  64.  * Set state information for each point along a curve.  This is called
  65.  * at every point along a user-drawn curve (freehand draw, airbrush, etc.)
  66.  *
  67.  * You cannot rely on this being called after DM_PutInit(), or
  68.  * vice versa.
  69.  *
  70.  * x, y, and z will be -1 if the drawing tool in question is
  71.  * not a curve (eg. a box or something).
  72.  *
  73.  */
  74. void __asm DM_NewPoint (register __d0 int n,
  75.                         register __d1 int total,
  76.                         register __d2 int x,
  77.                         register __d3 int y,
  78.                         register __d4 int z)
  79. {
  80. }
  81.  
  82. /**********************************************************************\
  83.  
  84.                          Library Initialization Stuff
  85.  
  86. \**********************************************************************/
  87.  
  88. /*
  89.  * This is the table of all the functions that can be called in this
  90.  * module.  The first four (Open, Close, Expunge, and Null) are reserved
  91.  * for system use and MUST be specified in the order shown.  The actual
  92.  * functions are in the standard module startup code.
  93.  */
  94. ULONG FuncTable[] = {
  95.    /* These four MUST be present in this order */
  96.    (ULONG) LibOpen,
  97.    (ULONG) LibClose,
  98.    (ULONG) LibExpunge,
  99.    (ULONG) LibNull,
  100.  
  101.    /* Specific to the module */
  102.    (ULONG) DM_PutInit,
  103.    (ULONG) DM_PutCleanup,
  104.    (ULONG) DM_PutColor,
  105.    (ULONG) DM_PutGrey,
  106.    (ULONG) DM_NewPoint,
  107.  
  108.    /* End with -1L */
  109.    (ULONG) -1L
  110. };
  111.  
  112. /*
  113.  * These are used by the standard module startup code.
  114.  * LibraryName is the name of the library, and LibraryID is a short
  115.  * description of the library.  Both of these are largely irrelavent,
  116.  * but they are included just for completeness.
  117.  */
  118. UBYTE LibraryID[]    = "$VER: Skeleton Drawing Mode 1.04.00 (20.5.93)";
  119. UBYTE LibraryType    = NT_DRAWMODE;
  120.  
  121. /*
  122.  * This is called by the standard module startup code when Image Scan
  123.  * first opens the module.  Here we should fill in the NumGads,
  124.  * NewGad, Language, and LangCount fields of the provided ModuleBase
  125.  * structure if necessary.
  126.  */
  127. long  __asm UserOpen (register __a6 struct ModuleBase *modbase)
  128. {
  129.    return(TRUE);
  130. }
  131.  
  132. /*
  133.  * This is called by the standard module startup code when Image Scan
  134.  * closes the module.  It should cleanup anything allocated or obtained
  135.  * in the UserOpen() function.
  136.  */
  137. long  __asm UserClose (register __a6 struct ModuleBase *modbase)
  138. {
  139.    return(TRUE);
  140. }
  141.  
  142.